package com.ruoyi.workflow.service.impl;

import java.util.Collection;
import java.util.List;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.workflow.mapper.StoreInfoMapper;
import com.ruoyi.workflow.domain.StoreInfo;
import com.ruoyi.workflow.service.IStoreInfoService;

/**
 * 门店信息Service业务层处理
 *
 * @author xiaoliu
 * @date 2022-11-24
 */
@Service
public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo> implements IStoreInfoService {

    @Autowired
    private ISysUserService userService;
    /**
     * 查询门店信息列表
     *
     * @param storeInfo 门店信息
     * @return 门店信息
     */
    @Override
    public List<StoreInfo> selectStoreInfoList(StoreInfo storeInfo) {
        return getBaseMapper().selectStoreInfoList(storeInfo);
    }

    public boolean removeBatchByIds(List<Long> ids) {
        return getBaseMapper().updateBatchByIds(ids);
    }

    @Override
    public boolean save(StoreInfo entity) {
        SysUser sysUser = userService.selectUserById(1l);
        entity.setManagerName(sysUser.getNickName());
        entity.setManagerTel(sysUser.getPhonenumber());
        return super.save(entity);
    }
}
